<?php
/**
 * CreateTime: 2023/1/11 11:15
 */

namespace App\Func;

use App\Models\MeClient\MeClientModel;
use App\Tools\SnowFlake;

class MeLawCaseFunc
{
    public static function getLawCaseUnionCode($clientId,$count){
        try {
            $snowFlakeCode = rand(1000000000,9999999999).$count;
//            $id = $snowflake->nextId();
//            $snowFlakeCode = $id;
            $clientCode = (new MeClientModel())->getByIdNoAuth($clientId,['client_code'])['client_code'] ?? false;
            if(!$clientCode){
                // 委托方不存在的情况下
                return false;
            }
            $lawCaseCode = $clientCode."".$snowFlakeCode;
            return $lawCaseCode;
        }catch (\Exception $exception){
            return false;
        }


    }
}